package us.mooresr.webtroopmanager.client.events;

import us.mooresr.webtroopmanager.shared.PersonSummary;

import com.google.gwt.event.shared.GwtEvent;

public class PersonAddedEvent extends GwtEvent<PersonAddedHandler>{
	
	private final PersonSummary personSummary;
	
	public PersonAddedEvent(PersonSummary personSummary) {
		super();
		this.personSummary = personSummary;
	}

	public static final Type<PersonAddedHandler> TYPE = new Type<PersonAddedHandler>();

	@Override
	protected void dispatch(PersonAddedHandler handler) {
		handler.onAddPerson(this);	
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<PersonAddedHandler> getAssociatedType() {
		return TYPE;
	}

	public PersonSummary getPersonSummary() {
		return personSummary;
	}

	
}
